//
//  ExaminaStatisticsController.m
//  Coach_HaiGeEr
//
//  Created by liuchen on 2018/10/22.
//  Copyright © 2018年 海格尔. All rights reserved.
//

#import "ExaminaStatisticsController.h"
#import "ExaminaStatisticsDetailController.h"
#import "ExaminaColumnView.h"

@interface ExaminaStatisticsController ()
@property (nonatomic,strong) ExaminaColumnView *indicatorView;
@property (nonatomic,strong) ExaminaStatisticsDetailController *subjectTwoVC;
@property (nonatomic,strong) ExaminaStatisticsDetailController *subjectThreeVC;
@end

@implementation ExaminaStatisticsController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [[CoachTabBarController shareLZHTabbarController].tabBar setHidden:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createSubView];
}

#pragma mark ==========创建视图==========
- (void)createSubView{
    self.title = @"历史统计";
    [self setNavBack];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.indicatorView];
    [self addChildViewController:self.subjectTwoVC];
    [self addChildViewController:self.subjectThreeVC];
}

#pragma mark ==========懒加载==========
- (ExaminaColumnView *)indicatorView{
    if (!_indicatorView) {
        _indicatorView = [[ExaminaColumnView alloc] initWithFrame:CGRectMake(0, SYSTEM_TOP, SCREEN_WIDTH, SCREEN_HEIGHT-SYSTEM_TOP) WithTitle:@[@"科目二",@"科目三"]];
        [_indicatorView.contentSrcView addSubview:self.subjectTwoVC.view];
        [_indicatorView.contentSrcView addSubview:self.subjectThreeVC.view];
    }
    return _indicatorView;
}
- (ExaminaStatisticsDetailController *)subjectTwoVC{
    if (!_subjectTwoVC) {
        _subjectTwoVC = [[ExaminaStatisticsDetailController alloc] init];
        WS(ws);
        _subjectTwoVC.block = ^(BOOL judge) {
            if (judge) {
                [ws toLoginVC];
            }
        };
        _subjectTwoVC.type = 2;
        _subjectTwoVC.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, CGRectGetHeight(self.view.frame)-SYSTEM_TOP);
    }
    return _subjectTwoVC;
}
- (ExaminaStatisticsDetailController *)subjectThreeVC{
    if (!_subjectThreeVC) {
        _subjectThreeVC = [[ExaminaStatisticsDetailController alloc] init];
        WS(ws);
        _subjectThreeVC.block = ^(BOOL judge) {
            if (judge) {
                [ws toLoginVC];
            }
        };
        _subjectThreeVC.type = 3;
        _subjectThreeVC.view.frame = CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, CGRectGetHeight(self.view.frame)-SYSTEM_TOP);
    }
    return _subjectThreeVC;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc{

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
